package top.riske.animalhazardassessment.animal.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import top.riske.animalhazardassessment.animal.service.SpeciesService;
import top.riske.animalhazardassessment.common.entity.Species;
import top.riske.animalhazardassessment.common.mapper.SpeciesMapper;

import java.util.List;

@Service
public class SpeciesServiceImpl extends ServiceImpl<SpeciesMapper, Species> implements SpeciesService {

    @Resource
    private SpeciesMapper speciesMapper;

    @Override
    public List<Species> getSpecies() {
        return speciesMapper.selectList(null);
    }

    @Override
    public int addSpecies(Species species) {
        return speciesMapper.insert(species);
    }

    @Override
    public int deleteSpecies(Long id) {
        return speciesMapper.deleteById(id);
    }

    @Override
    public int updateSpecies(Species species) {
        return speciesMapper.updateById(species);
    }
}
